﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbHatchScaleContextData : OdDbAnnotScaleObjectContextData
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbHatchScaleContextData(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbHatchScaleContextData_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbHatchScaleContextData obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbHatchScaleContextData()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbHatchScaleContextData(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbHatchScaleContextData cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbHatchScaleContextData_cast(OdRxObject.getCPtr(pObj));
			OdDbHatchScaleContextData result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHatchScaleContextData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHatchScaleContextData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHatchScaleContextData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbHatchScaleContextData_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbHatchScaleContextData_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbHatchScaleContextData_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbHatchScaleContextData createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbHatchScaleContextData_createObject();
			OdDbHatchScaleContextData result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbHatchScaleContextData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbHatchScaleContextData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbHatchScaleContextData)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void appendLoop(int loopType, EdgeArray edgePtrs)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_appendLoop(this.swigCPtr, loopType, EdgeArray.getCPtr(edgePtrs));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getLoopAt(OdDbHatch arg0, int i, out int loopType, EdgeArray edgePtrs)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_getLoopAt(this.swigCPtr, OdDbHatch.getCPtr(arg0), i, out loopType, EdgeArray.getCPtr(edgePtrs));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void insertLoopAt(int i, int loopType, EdgeArray edgePtrs)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_insertLoopAt(this.swigCPtr, i, loopType, EdgeArray.getCPtr(edgePtrs));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int loopTypeAt(int i)
		{
			int result = TD_DbPINVOKE.OdDbHatchScaleContextData_loopTypeAt(this.swigCPtr, i);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int numLoops()
		{
			int result = TD_DbPINVOKE.OdDbHatchScaleContextData_numLoops(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void removeLoopAt(int i)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_removeLoopAt(this.swigCPtr, i);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setLoopAt(int i, int loopType, EdgeArray edgePtrs)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setLoopAt(this.swigCPtr, i, loopType, EdgeArray.getCPtr(edgePtrs));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setLoopTypeAt(int i, int loopType)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setLoopTypeAt(this.swigCPtr, i, loopType);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setNumLoops(int i)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setNumLoops(this.swigCPtr, i);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdHatchPattern hatchPattern()
		{
			OdHatchPattern result = new OdHatchPattern(TD_DbPINVOKE.OdDbHatchScaleContextData_hatchPattern(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setHatchPattern(OdHatchPattern arg0)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setHatchPattern(this.swigCPtr, OdHatchPattern.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeVector3d patternBaseAngle()
		{
			OdGeVector3d result = new OdGeVector3d(TD_DbPINVOKE.OdDbHatchScaleContextData_patternBaseAngle(this.swigCPtr), true);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public double patternScale()
		{
			double result = TD_DbPINVOKE.OdDbHatchScaleContextData_patternScale(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setPatternBaseAngle(OdGeVector3d arg0)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setPatternBaseAngle(this.swigCPtr, OdGeVector3d.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setPatternScale(double arg0)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setPatternScale(this.swigCPtr, arg0);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getHatchLineDataAt(OdDbHatch arg0, int n, OdGePoint2d startPt, OdGePoint2d endPt)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_getHatchLineDataAt(this.swigCPtr, OdDbHatch.getCPtr(arg0), n, OdGePoint2d.getCPtr(startPt), OdGePoint2d.getCPtr(endPt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getHatchLinesData(OdDbHatch arg0, OdGePoint2dArray startPts, OdGePoint2dArray endPts)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_getHatchLinesData(this.swigCPtr, OdDbHatch.getCPtr(arg0), OdGePoint2dArray.getCPtr(startPts).Handle, OdGePoint2dArray.getCPtr(endPts).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setHatchLineDataAt(int n, OdGePoint2d startPt, OdGePoint2d endPt)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setHatchLineDataAt(this.swigCPtr, n, OdGePoint2d.getCPtr(startPt), OdGePoint2d.getCPtr(endPt));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setHatchLinesData(OdGePoint2dArray startPts, OdGePoint2dArray endPts)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setHatchLinesData(this.swigCPtr, OdGePoint2dArray.getCPtr(startPts).Handle, OdGePoint2dArray.getCPtr(endPts).Handle);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool isValidHatchLines(OdDbHatch arg0)
		{
			bool result = TD_DbPINVOKE.OdDbHatchScaleContextData_isValidHatchLines(this.swigCPtr, OdDbHatch.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setEvaluateHatch(bool arg0)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_setEvaluateHatch(this.swigCPtr, arg0);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public int numHatchLines(OdDbHatch arg0)
		{
			int result = TD_DbPINVOKE.OdDbHatchScaleContextData_numHatchLines(this.swigCPtr, OdDbHatch.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void transformBy(OdGeMatrix2d arg0)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_transformBy(this.swigCPtr, OdGeMatrix2d.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual void copyFrom(OdRxObject arg0)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_copyFrom(this.swigCPtr, OdRxObject.getCPtr(arg0));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbHatchScaleContextData_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbHatchScaleContextData_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
